package com.ys.service.sys;

import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.ui.Model;

import com.ys.vo.R;

import lombok.AllArgsConstructor;
import lombok.Data;

public interface CommonService {
	
	String indexCommonOfMenu(Model model,
    		HttpServletRequest request,
    		Long menuId);
	@Data
	@AllArgsConstructor
	public class GridDto {
		private MenuDto menu;
		private List<String> colGridArr; // 字段数组，按照layui的格式给
		private ToolbarDto toolbar; // 工具栏

		@Data
		@AllArgsConstructor
		public static class MenuDto {
			private String pathGridRequest; // 表格数据请求地址
			private String pathGridEditRequest; // 表格数据编辑请求地址
		}

		@Data
		@AllArgsConstructor
		public static class ToolbarDto {
			private String buttonHtml; // 按钮HTML
			private String buttonScript; // 按钮脚本
		}

		@Data
		@AllArgsConstructor
		public static class ButtonDto {
			private String htmls;
			private String scripts;
		}

		@Data
		@AllArgsConstructor
		public static class ColEditDto {
			private String elementScriptsOfText; // 编辑脚本的拼接，文本框类型
			private String elementScriptsOfNoText; // 编辑脚本的拼接，非文本框类型
			private List<ElementDto> elementArr; // 元素数组

			@Data
			@AllArgsConstructor
			public static class ElementDto {
				private String elementId; // 元素id
				private String elementHtml; // 元素html
			}
		}
	}
	
	R editOnTable(HttpServletRequest request);
	
	R edit(Map<String, Object> params);
}
